package edu.pku.sei.transformation.editor.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class NameValidator {
	public static boolean validate(String name) {
		Pattern p = Pattern.compile("[a-zA-Z_][a-zA-Z0-9_]*");
		Matcher m = p.matcher(name);
		return m.matches();
	}

	public static void main(String[] args) {
		System.out.println(NameValidator.validate("a_b"));
	}
}
